package org.clockworkmages.games.anno1186.situations.gameoptions.options;

import org.clockworkmages.games.anno1186.GameBeansContext;
import org.clockworkmages.games.anno1186.GameStateService;
import org.clockworkmages.games.anno1186.model.option.Option;
import org.clockworkmages.games.anno1186.situations.gameoptions.LoadGameSituation;

public class LoadGameOption
		extends Option {

	private GameStateService gameStateService;

	public LoadGameOption() {
		gameStateService = GameBeansContext.getBean(GameStateService.class);
		this.setLabel("Load game");
	}

	@Override
	public void select() {
		LoadGameSituation situation = new LoadGameSituation();
		gameStateService.addSituation(situation, true);
		super.select();
	}
}
